<?php
    $page = "pages/".$_POST["page"].".txt";
    $content = $_POST["content"];
    if (($f = fopen($page, "w")) == false) {
        echo "ERROR";
        return;
    }
    fwrite($f, $content);
    fclose($f);
    echo "OK";
?>
